class CreateMembers < ActiveRecord::Migration
  def self.up
    create_table :members do |t|
      t.integer :accounts_id, :null => false
      t.string :nick ,:limit => 32
      t.string :sex ,:limit=>2
      t.date :birthday
      t.string :astro,:limit=>8
      t.string :university,:limit => 64
      t.string :major,:limit => 32
      t.string :hometown,:limit => 64
      t.string :blood,:limit => 8
      t.string :height,:limit => 8
      t.string :weight,:limit => 8
      t.string :emotion,:limit => 8
      t.string :intent,:limit => 8
      t.string :realname,:limit => 16
      t.string :mobile,:limit => 11
      t.string :qq,:limit => 10

      t.timestamps
    end
    add_index :members, :accounts_id, :name => "fk_accounts_member"
    add_index :members, :nick
    add_index :members, :university
  end

  def self.down
    drop_table :members
  end
end
